import request from '@/utils/request'

// 查询设备数据列表 - 调用EMQX微服务
export function listDeviceData(query) {
  return request({
    url: '/getDeviceDetailsList',
    method: 'get',
    params: query
  })
}

// 新增设备数据 - 调用EMQX微服务
export function addDeviceDetails(data) {
  return request({
    url: '/addDeviceDetails',  // 修改为正确的接口
    method: 'post',
    data: data
  })
}

export function getDeviceDataBySensorId(sensorId, size) {
  return request({
    url: '/getDeviceDataBySensorIdList',
    method: 'get',
    params: {
      sensorId: sensorId,
      size: size
    }
  })
}